<!DOCTYPE html>
<html lang="en">
	<head>
		<meta charset="utf-8" />
		<title>订单列表</title>
		<meta name="keywords" content="Bootstrap模版,Bootstrap模版下载,Bootstrap教程,Bootstrap中文" />
		<meta name="description" content="站长素材提供Bootstrap模版,Bootstrap教程,Bootstrap中文翻译等相关Bootstrap插件下载" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0" />

		<!-- basic styles -->

		<link href="assets/css/bootstrap.min.css" rel="stylesheet" />
		<link rel="stylesheet" href="assets/css/font-awesome.min.css" />
        <link rel="stylesheet"  href="assets/css/kkpager_orange.css" />

		<!--[if IE 7]>
		  <link rel="stylesheet" href="assets/css/font-awesome-ie7.min.css" />
		<![endif]-->

		<!-- page specific plugin styles -->

		<!-- ace styles -->

		<link rel="stylesheet" href="assets/css/ace.min.css" />
		<link rel="stylesheet" href="assets/css/ace-rtl.min.css" />
		<link rel="stylesheet" href="assets/css/ace-skins.min.css" />

		<!--[if lte IE 8]>
		  <link rel="stylesheet" href="assets/css/ace-ie.min.css" />
		<![endif]-->

		<!-- inline styles related to this page -->

		<!-- ace settings handler -->

		<script src="assets/js/ace-extra.min.js"></script>

		<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->

		<!--[if lt IE 9]>
		<script src="assets/js/html5shiv.js"></script>
		<script src="assets/js/respond.min.js"></script>
		<![endif]-->
	</head>

	<body>
		<#include "header.ftl"/>

		<div class="main-container" id="main-container">
			<script type="text/javascript">
				try{ace.settings.check('main-container' , 'fixed')}catch(e){}
			</script>

			<div class="main-container-inner">
				<a class="menu-toggler" id="menu-toggler" href="#">
					<span class="menu-text"></span>
				</a>
				<#include "left_list_menu.ftl">
				<div class="main-content">
					<div class="breadcrumbs" id="breadcrumbs">
						<script type="text/javascript">
							try{ace.settings.check('breadcrumbs' , 'fixed')}catch(e){}
						</script>

						<ul class="breadcrumb">
							<li>
								<i class="icon-home home-icon"></i>
								订单管理
							</li>
							<li>
								订单列表
							</li>
						</ul><!-- .breadcrumb -->

					</div>

					<div class="page-content">
						<div class="page-header">
							<#--<h1>-->
								<#--客户信息列表-->
								<#--<small>-->
									<#--<i class="icon-double-angle-right"></i>-->
									<#--Static &amp; Dynamic Tables-->
								<#--</small>-->
							<#--</h1>-->
                                <input type="text" name="customer_name_key" id="customer_name_key" placeholder="请输入客户名称" value="${orderListView.customer_name !''}"/>
                                <input type="text" name="customer_phone_key" id="customer_phone_key" placeholder="请输入客户手机号" value="${orderListView.customer_phone !''}"/>
                                <input type="text" name="order_id_key" id="order_id_key" placeholder="请输入订单编号" value="<#if orderListView.order_id??>${orderListView.order_id?c}</#if>" maxlength="9" onkeyup="this.value=this.value.replace(/\D/g,'')"/>
								<label >类型 :</label>
                                <select id="order_type_key" >
									<option value="0">全部</option>
								<#if orderListView.order_type == 1>
                                    <option value="1" selected ="selected">空调</option>
								<#else >
                                    <option value="1">空调</option>
								</#if>
								<#if orderListView.order_type == 2>
                                    <option value="2" selected ="selected">地暖</option>
								<#else >
                                    <option value="2" >地暖</option>
								</#if>
								<#if orderListView.order_type == 3>
                                    <option value="3" selected ="selected">新风</option>
								<#else >
                                    <option value="3">新风</option>
								</#if>
								<#if orderListView.order_type == 4>
                                    <option value="4" selected ="selected">生活热水</option>
								<#else >
                                    <option value="4">生活热水</option>
								</#if>
								<#if orderListView.order_type == 5>
                                    <option value="5" selected ="selected">水处理</option>
								<#else >
                                    <option value="5">水处理</option>
								</#if>
								<#if orderListView.order_type == 6>
                                    <option value="6" selected ="selected">智能家居</option>
								<#else >
                                    <option value="6">智能家居</option>
								</#if>
                                </select>
                                <label >状态 :</label>
                                <select id="order_status_key" >
                                    <option value="0">全部</option>
								<#if orderListView.order_status == 1>
                                    <option value="1" selected ="selected">派单中</option>
								<#else >
                                    <option value="1">派单中</option>
								</#if>
								<#if orderListView.order_status == 2>
                                    <option value="2" selected ="selected">待上门</option>
								<#else >
                                    <option value="2" >待上门</option>
								</#if>
								<#if orderListView.order_status == 3>
                                    <option value="3" selected ="selected">检修中</option>
								<#else >
                                    <option value="3">检修中</option>
								</#if>
								<#if orderListView.order_status == 4>
                                    <option value="4" selected ="selected">待确认</option>
								<#else >
                                    <option value="4">待确认</option>
								</#if>
								<#if orderListView.order_status == 5>
                                    <option value="5" selected ="selected">待支付</option>
								<#else >
                                    <option value="5">待支付</option>
								</#if>
								<#if orderListView.order_status == 6>
                                    <option value="6" selected ="selected">待收款</option>
								<#else >
                                    <option value="6">待收款</option>
								</#if>
								<#if orderListView.order_status == 7>
                                    <option value="7" selected ="selected">已完成</option>
								<#else >
                                    <option value="7">已完成</option>
								</#if>
								<#if orderListView.order_status == 8>
                                    <option value="8" selected ="selected">已取消</option>
								<#else >
                                    <option value="8">已取消</option>
								</#if>
								<#if orderListView.order_status == 9>
                                    <option value="9" selected ="selected">调解中</option>
								<#else >
                                    <option value="9">调解中</option>
								</#if>
                                </select>
								<button id="search_order" type="button" class="btn btn-sm btn-primary">
                                    <i class="icon-search"></i>
                                    搜索
                                </button>
						</div><!-- /.page-header -->

						<div class="row">
							<div class="col-xs-12">
								<!-- PAGE CONTENT BEGINS -->
								<div class="row">
									<div class="col-xs-12">
										<div class="table-responsive">
											<table id="sample-table-1" class="table table-striped table-bordered table-hover">
												<thead>
													<tr>
														<th>订单编号</th>
														<th>客户姓名</th>
														<th class="hidden-480">客户手机号</th>
														<th class="hidden-480">订单类型</th>
														<th class="hidden-480">上门地址</th>
														<th class="hidden-480">预约时间</th>
														<th class="hidden-480">订单状态</th>
														<th class="hidden-480">下单时间</th>
														<th>操作</th>
													</tr>
												</thead>

												<tbody>
													<#list orderListViewList as list>
														<tr>
															<td>${list.order_id}</td>
															<td>${list.customer_name !""}</td>
															<td>${list.customer_phone !""}</td>
															<td>
																<#if list.order_type == 1>
                                                                    空调
																<#elseif list.order_type == 2>
                                                                    地暖
																<#elseif list.order_type == 3>
																	新风
																<#elseif list.order_type == 4>
																	生活热水
																<#elseif list.order_type == 5>
																	水处理
																<#elseif list.order_type == 6>
																	智能家居
																</#if>
															</td>
                                                            <td class="hidden-480">
																${list.address !""}${list.house_number !""}
                                                            </td>
                                                            <td class="hidden-480">
																${list.reserve_date?number?number_to_date !""}
                                                            </td>
                                                            <td class="hidden-480">
																<#if list.order_status == 1>
																		派单中
																	<#elseif list.order_status == 2>
																		待上门
																	<#elseif list.order_status == 3>
																		检修中
																	<#elseif list.order_status == 4>
                                                                    	待确认
																	<#elseif list.order_status == 5>
                                                                    	待支付
																	<#elseif list.order_status == 6>
                                                                    	待收款
																	<#elseif list.order_status == 7>
																		已完成
																	<#elseif list.order_status == 8>
                                                                    	已取消
																	<#elseif list.order_status == 9>
                                                                    	调解中
																</#if>
                                                            </td>
															<td>${list.createtime?number?number_to_date !""}</td>
															<td>
																<div class="visible-md visible-lg hidden-sm hidden-xs btn-group">
																	<button class="btn btn-xs btn-success" onclick="detailThis(${list.order_id?c},'selectOrderDetailById?order_id=')">详情</button>
																</div>
																<div class="visible-xs visible-sm hidden-md hidden-lg">
																	<div class="inline position-relative">
																		<button class="btn btn-minier btn-primary dropdown-toggle" data-toggle="dropdown">
																			<i class="icon-cog icon-only bigger-110"></i>
																		</button>

																		<ul class="dropdown-menu dropdown-only-icon dropdown-yellow pull-right dropdown-caret dropdown-close">
																			<li>
																				<a href="#" class="tooltip-info" data-rel="tooltip" title="View">
																					<span class="blue">
																						<i class="icon-zoom-in bigger-120"></i>
																					</span>
																				</a>
																			</li>

																			<li>
																				<a href="#" class="tooltip-success" data-rel="tooltip" title="Edit">
																					<span class="green">
																						<i class="icon-edit bigger-120"></i>
																					</span>
																				</a>
																			</li>

																			<li>
																				<a href="#" class="tooltip-error" data-rel="tooltip" title="Delete">
																					<span class="red">
																						<i class="icon-trash bigger-120"></i>
																					</span>
																				</a>
																			</li>
																		</ul>
																	</div>
																</div>
															</td>
														</tr>
													</#list>
												</tbody>
											</table>
                                            <div class="modal-footer no-margin-top">
                                                <div id="kkpager"></div>
                                            </div>
										</div><!-- /.table-responsive -->
									</div><!-- /span -->
								</div><!-- /row -->

								<div class="hr hr-18 dotted hr-double"></div>
							</div><!-- /.col -->
						</div><!-- /.row -->
					</div><!-- /.page-content -->
				</div><!-- /.main-content -->

			</div><!-- /.main-container-inner -->

			<a href="#" id="btn-scroll-up" class="btn-scroll-up btn btn-sm btn-inverse">
				<i class="icon-double-angle-up icon-only bigger-110"></i>
			</a>
		</div><!-- /.main-container -->

		<!-- basic scripts -->


		<!--[if !IE]> -->

		<script type="text/javascript">
			window.jQuery || document.write("<script src='assets/js/jquery-2.0.3.min.js'>"+"<"+"/script>");
		</script>

		<!-- <![endif]-->

		<!--[if IE]>
<script type="text/javascript">
 window.jQuery || document.write("<script src='assets/js/jquery-1.10.2.min.js'>"+"<"+"/script>");
</script>
<![endif]-->

		<script type="text/javascript">
			if("ontouchend" in document) document.write("<script src='assets/js/jquery.mobile.custom.min.js'>"+"<"+"/script>");
		</script>
        <script type="text/javascript" src="assets/js/jquery-1.10.2.min.js"></script>
		<script src="assets/js/bootstrap.min.js"></script>
		<script src="assets/js/typeahead-bs2.min.js"></script>

		<!-- page specific plugin scripts -->

		<script src="assets/js/jquery.dataTables.min.js"></script>
		<script src="assets/js/jquery.dataTables.bootstrap.js"></script>

		<!-- ace scripts -->

		<script src="assets/js/ace-elements.min.js"></script>
		<script src="assets/js/ace.min.js"></script>

        <script type="text/javascript" src="assets/js/kkpager.min.js"></script>
		<script src="assets/js/myJs.js"></script>

		<!-- inline scripts related to this page -->

        <script src="assets/js/jquery.cookie.js"></script>
        <script type="text/javascript">
            window.onload=function(){
                var name = $.cookie('username');
                if (name == '' || name == null || typeof(name)=="undefined"){
                    document.getElementById("user_name").innerText="unknown user";
                    alert("请先登录");
                    window.location.href='login';
                }

                document.getElementById("user_name").innerText=name;
            }


            $(function(){
                //生成分页
                //有些参数是可选的，比如lang，若不传有默认值
                kkpager.generPageHtml({
                    pno : '${pageInfo.page_index}',
                    //总页码
                    total : '${pageInfo.page_count}',
                    //总数据条数
                    totalRecords : '${pageInfo.count_info}',
                    mode : 'click',//默认值是link，可选link或者click
                    click : function(n){
                        // do something
                        window.location.href = '${pageInfo.page_href}'+ n;
                        //手动选中按钮
                        this.selectPage(n);
                        return false;
                    }
                });
            });

            $("#search_order").click(function(){
                var selectRequestString = 'selectOrderList?order_type=';
                var order_type = $("#order_type_key").val();
                var order_statusr_type = $("#order_status_key").val();
                selectRequestString = selectRequestString + order_type+"&order_status="+order_statusr_type;
                var customer_name = $("input[name='customer_name_key']").val();
                if (customer_name != null && customer_name != ''){
                    selectRequestString = selectRequestString+"&customer_name="+customer_name;
				}
                var customer_phone = $("input[name='customer_phone_key']").val();
                if (customer_phone != null && customer_phone != ''){
                    selectRequestString = selectRequestString+"&customer_phone="+customer_phone;
                }
                var order_id = $("input[name='order_id_key']").val();
                if (order_id != null && order_id != ''){
                    selectRequestString = selectRequestString+"&order_id="+order_id;
                }
                window.location.href = selectRequestString+"&page=1";
            });

			jQuery(function($) {
				var oTable1 = $('#sample-table-2').dataTable( {
				"aoColumns": [
			      { "bSortable": false },
			      null, null,null, null, null,
				  { "bSortable": false }
				] } );
				
				
				$('table th input:checkbox').on('click' , function(){
					var that = this;
					$(this).closest('table').find('tr > td:first-child input:checkbox')
					.each(function(){
						this.checked = that.checked;
						$(this).closest('tr').toggleClass('selected');
					});
						
				});
			
			
				$('[data-rel="tooltip"]').tooltip({placement: tooltip_placement});
				function tooltip_placement(context, source) {
					var $source = $(source);
					var $parent = $source.closest('table')
					var off1 = $parent.offset();
					var w1 = $parent.width();
			
					var off2 = $source.offset();
					var w2 = $source.width();
			
					if( parseInt(off2.left) < parseInt(off1.left) + parseInt(w1 / 2) ) return 'right';
					return 'left';
				}
			})
		</script>
<#--<script type="text/javascript">-->
<#--var _bdhmProtocol = (("https:" == document.location.protocol) ? " https://" : " http://");-->
<#--document.write(unescape("%3Cscript src='" + _bdhmProtocol + "hm.baidu.com/h.js%3Fe9e1d61340ff3d9495a8cca04ebdb49d' type='text/javascript'%3E%3C/script%3E"));-->
<#--</script>-->
<#--<a href="http://www.iteblog.com">过往记忆</a>-->
</body>
</html>
